<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <input type="text" v-model.number='count'>

        <input type="text" v-model.trim='msg'>
        <!-- 字符串去空 -->
        {{msg| filterMsg}}
    </div>

    <script src="../20211018/vue.js"></script>

    <script>
        let myApp=new Vue({
            el:'#app',
            data:{
                count:0,
                msg:''
            },
            methods:{},
            filters:{
                filterMsg(value){
                    //正则表达式
                    let reg=/\s/g

                    return value.replace(reg,'')
                }
            }
        })
    </script>
</body>
</html>